Revert "sizerequest: Only check reported baselines if requested"
authorBenjamin Otte <otte@redhat.com>
Sat, 6 Nov 2021 17:26:41 +0000 (18:26 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 9 Nov 2021 02:41:43 +0000 (03:41 +0100)
This reverts commit cf7fa931d380c6d205478c87f0f3973f496f9d2a.

We store the baseline in the cache and we do not know if baselines might
be queried in the future. So always store them.

No reftest because I don't know how to write one.

premature optimization == √😈

gtk/gtksizerequest.c

index 45770d549844aef25b6f5eeae1ed259ae7ef9508..a0f066b997d436d316a54b35b87de9d11b41c7f2 100644 (file)
@@ -139,7 +139,6 @@ gtk_widget_query_size_for_orientation (GtkWidget        *widget,
                                        int              *minimum_baseline,
                                        int              *natural_baseline)
 {
-  const gboolean baselines_requested = (minimum_baseline != NULL || natural_baseline != NULL);
   SizeRequestCache *cache;
   int min_size = 0;
   int nat_size = 0;
@@ -361,7 +360,7 @@ gtk_widget_query_size_for_orientation (GtkWidget        *widget,
           nat_size = adjusted_natural;
         }
 
-      if (baselines_requested && (min_baseline != -1 || nat_baseline != -1))
+      if (min_baseline != -1 || nat_baseline != -1)
        {
          if (orientation == GTK_ORIENTATION_HORIZONTAL)
            {